﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EdexApiClient.api.v2
{
    public partial class EdexApiContext
    {
        public async Task<CommonApiResponse<SEC_USER_COMPANIES>> GetAllowedCompanies(Guid USER_GUID)
        {
            var uri = String.Format("v2/usercompanies/?api_key={0}", this.api_key);
            uri += "&$filter=USER_GUID eq Guid'" + USER_GUID + "'";
            uri += "&$expand=COMPANY";

            uri = System.IO.Path.Combine(this.ApiUri, uri);

            return await this.GetData<SEC_USER_COMPANIES>(uri);
        }

    }
}
